package com.greentravel.model;

/**
 * 用户实体类
 * 存储用户的基本信息
 */
public class User {
    private int id; // 用户ID
    private String username; // 用户名
    private String password; // 密码
    private String name; // 姓名
    private String contact; // 联系方式
    private String region; // 所在地区
    private int points; // 积分

    // 默认构造方法
    public User() {
    }

    // 带参数的构造方法
    public User(int id, String username, String password, String name, String contact, String region, int points) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.name = name;
        this.contact = contact;
        this.region = region;
        this.points = points;
    }

    // 注册用构造方法
    public User(String username, String password, String name, String contact, String region) {
        this.username = username;
        this.password = password;
        this.name = name;
        this.contact = contact;
        this.region = region;
        this.points = 0;
    }

    // getter和setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public int getPoints() {
        return points;
    }

    public void setPoints(int points) {
        this.points = points;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", name='" + name + '\'' +
                ", contact='" + contact + '\'' +
                ", region='" + region + '\'' +
                ", points=" + points +
                '}';
    }
}